import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsOptional, IsInt, IsString, Min } from 'class-validator';
import { Type } from 'class-transformer';
import {PaginationDto} from '@/common/dto/pagination.dto';

export class QueryUserDto extends PaginationDto{
  @ApiPropertyOptional({ description: '用户名模糊查询' })
  @IsOptional()
  @IsString()
  name?: string;

  @ApiPropertyOptional({ description: '年龄精确查询' })
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(3)
  age?: number;
}
